﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DXApplicationTangche.UC.门店出入库.Service;
using DiaoPaiDaYin;
using Seagull.BarTender.Print;

namespace DXApplicationTangche.UC.门店出入库.淘宝
{
    public partial class Form包装信息 : DevExpress.XtraEditors.XtraForm
    {
        public Form包装信息(GarmentPackageInfoDTO garmentPackageInfoDTO,String sfExpressNo)
        {
            InitializeComponent();
            this.textBox包装码.Text = garmentPackageInfoDTO.packageBarcode;
            this.textBox快递单号.Text = sfExpressNo;
            this.textBox收件人.Text = garmentPackageInfoDTO.contact;
            this.textBox电话.Text = garmentPackageInfoDTO.mobile;
            this.textBox省份.Text = garmentPackageInfoDTO.province;
            this.textBox城市.Text = garmentPackageInfoDTO.city;
            this.textBox区域.Text = garmentPackageInfoDTO.county;
            this.richTextBox详细地址.Text = garmentPackageInfoDTO.address;
            this.textBox邮编.Text = garmentPackageInfoDTO.postCode;
        }

        private void simpleButton确认_Click(object sender, EventArgs e)
        {
            DialogResult dr = MessageBox.Show("确定信息？", "提示:确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (dr == DialogResult.OK)
            {
                try
                {
                    出入库Service.get保存包装码和快递单(this.textBox包装码.Text.Trim(), this.textBox快递单号.Text.Trim());
                    MessageBox.Show("操作完成");
                }
                catch 
                {
                    MessageBox.Show("操作失败");
                }
                this.Close();
            }
            else
            {
                return;
            }
        }

    }
}